package cn.edu.njuit.springbootfilmreview.dto;

import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;

/**
 * 影片信息
 * @TableName movie_info
 */
@Data
public class MovieInfo implements Serializable {
    /**
     * 影片编号
     */
    @TableId
    private Long movieId;

    /**
     * 影片中文名称
     */
    private String name;

    /**
     * 英文名称
     */
    private String nameEn;

    /**
     * 海报缩略图
     */
    private String img;

    /**
     * 海报清晰图
     */
    private String bigImage;

    /**
     * 其他名称
     */
    private String titleOthers;

    /**
     * 平均评分
     */
    private Double rating;

    /**
     * 关联导演
     */
    private Long directorId;

    /**
     * 演员数
     */
    private Integer personCount;

    /**
     * 剧情
     */
    private String story;

    /**
     * 评分人数
     */
    private Long ratingCount;

    /**
     * 影片时长
     */
    private Integer length;

    /**
     * 上映日期
     */
    private String moviePublishDate;

    /**
     * 年份
     */
    private Integer movieYear;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        MovieInfo other = (MovieInfo) that;
        return (this.getMovieId() == null ? other.getMovieId() == null : this.getMovieId().equals(other.getMovieId()))
            && (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
            && (this.getNameEn() == null ? other.getNameEn() == null : this.getNameEn().equals(other.getNameEn()))
            && (this.getImg() == null ? other.getImg() == null : this.getImg().equals(other.getImg()))
            && (this.getBigImage() == null ? other.getBigImage() == null : this.getBigImage().equals(other.getBigImage()))
            && (this.getTitleOthers() == null ? other.getTitleOthers() == null : this.getTitleOthers().equals(other.getTitleOthers()))
            && (this.getRating() == null ? other.getRating() == null : this.getRating().equals(other.getRating()))
            && (this.getDirectorId() == null ? other.getDirectorId() == null : this.getDirectorId().equals(other.getDirectorId()))
            && (this.getPersonCount() == null ? other.getPersonCount() == null : this.getPersonCount().equals(other.getPersonCount()))
            && (this.getStory() == null ? other.getStory() == null : this.getStory().equals(other.getStory()))
            && (this.getRatingCount() == null ? other.getRatingCount() == null : this.getRatingCount().equals(other.getRatingCount()))
            && (this.getLength() == null ? other.getLength() == null : this.getLength().equals(other.getLength()))
            && (this.getMoviePublishDate() == null ? other.getMoviePublishDate() == null : this.getMoviePublishDate().equals(other.getMoviePublishDate()))
            && (this.getMovieYear() == null ? other.getMovieYear() == null : this.getMovieYear().equals(other.getMovieYear()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getMovieId() == null) ? 0 : getMovieId().hashCode());
        result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
        result = prime * result + ((getNameEn() == null) ? 0 : getNameEn().hashCode());
        result = prime * result + ((getImg() == null) ? 0 : getImg().hashCode());
        result = prime * result + ((getBigImage() == null) ? 0 : getBigImage().hashCode());
        result = prime * result + ((getTitleOthers() == null) ? 0 : getTitleOthers().hashCode());
        result = prime * result + ((getRating() == null) ? 0 : getRating().hashCode());
        result = prime * result + ((getDirectorId() == null) ? 0 : getDirectorId().hashCode());
        result = prime * result + ((getPersonCount() == null) ? 0 : getPersonCount().hashCode());
        result = prime * result + ((getStory() == null) ? 0 : getStory().hashCode());
        result = prime * result + ((getRatingCount() == null) ? 0 : getRatingCount().hashCode());
        result = prime * result + ((getLength() == null) ? 0 : getLength().hashCode());
        result = prime * result + ((getMoviePublishDate() == null) ? 0 : getMoviePublishDate().hashCode());
        result = prime * result + ((getMovieYear() == null) ? 0 : getMovieYear().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", movieId=").append(movieId);
        sb.append(", name=").append(name);
        sb.append(", nameEn=").append(nameEn);
        sb.append(", img=").append(img);
        sb.append(", bigImage=").append(bigImage);
        sb.append(", titleOthers=").append(titleOthers);
        sb.append(", rating=").append(rating);
        sb.append(", directorId=").append(directorId);
        sb.append(", personCount=").append(personCount);
        sb.append(", story=").append(story);
        sb.append(", ratingCount=").append(ratingCount);
        sb.append(", length=").append(length);
        sb.append(", moviePublishDate=").append(moviePublishDate);
        sb.append(", movieYear=").append(movieYear);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}